This Message Hub example project relies on Message Hub credentials being stored in a file called vcap.json locally.

Edit the cell below to set the following variables:

  • kafka_brokers_sasl
  • user
  • password

The above values can be found by:

  1. Login to the Bluemix console
  2. Navigating to your Message Hub service instance
  3. Click on service credentials
  4. Click on view credentials

Finally create a Message Hub topic, and set the following variable:

  • topic

After setting up the variables below, Run the cell to save your credentials.


In [ ]:
%%bash

# save our credential details for kafka
cat << EOF > vcap.json
{
  "kafka_brokers_sasl": [
    "kafka05-prod01.messagehub.services.us-south.bluemix.net:9093",
    "kafka03-prod01.messagehub.services.us-south.bluemix.net:9093",
    "kafka04-prod01.messagehub.services.us-south.bluemix.net:9093",
    "kafka01-prod01.messagehub.services.us-south.bluemix.net:9093",
    "kafka02-prod01.messagehub.services.us-south.bluemix.net:9093"
  ],
  "user": "changeme",
  "password": "changeme",
  "topic": "changeme"
}
EOF